// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// This file was generated by scripts/generate-benchmark.py, do not modify!

const dataBig = [{
  a: '-0x99BACB150D89489',
  b: '0x0',
  r: '-0x99BACB150D89489',
}, {
  a: '0xE907C36BD83131A5',
  b: '-0xD',
  r: '0x7483E1B5EC189',
}, {
  a: '0xEDB4F69C084A1E84EB0BE728318AFD636BA',
  b: '0xA6',
  r: '0x3B6D3DA7021287A13AC2F9CA0C62BF58DAE800000000000000000000000000000000000000000',
}, {
  a: '0xE8B81569A2542187520FA0481F4161973B1E4E0573274BE1795CF2',
  b: '-0x72',
  r: '0x3A2E055A68950861D483E81207',
}, {
  a: '0xD1CCC11EB41755DBDACF',
  b: '0x49',
  r: '0x1A399823D682EABB7B59E000000000000000000',
}, {
  a: '0x50E92103E527B7E005A617145CC8B761D6835ABEFFDF2E2E74D50D',
  b: '0x64',
  r: '0x50E92103E527B7E005A617145CC8B761D6835ABEFFDF2E2E74D50D0000000000000000000000000',
}, {
  a: '-0x29BEB1B5302FBD85AD2637DC5C476E126D1F39B2B091262B9E9',
  b: '0xB7',
  r: '-0x14DF58DA9817DEC2D6931BEE2E23B709368F9CD958489315CF48000000000000000000000000000000000000000000000',
}, {
  a: '-0xCFA914A25BCEA4B8E22550',
  b: '0xFD',
  r: '-0x19F522944B79D4971C44AA0000000000000000000000000000000000000000000000000000000000000000',
}, {
  a: '0x71226227D84BD7399DBA71139EDFE07362F21C397CF6DC99734618E',
  b: '0x3',
  r: '0x38913113EC25EB9CCEDD3889CF6FF039B1790E1CBE7B6E4CB9A30C70',
}, {
  a: '0x2869B297D731509B613BD8956DE4853DBDA43E08F22A1B2D510B66EA468A5F7E',
  b: '0xE',
  r: '0xA1A6CA5F5CC5426D84EF6255B79214F6F690F823C8A86CB5442D9BA91A297DF8000',
}, {
  a: '-0xC02B01FF6476991',
  b: '0x52',
  r: '-0x300AC07FD91DA64400000000000000000000',
}, {
  a: '0x799701C542AA8354932EDE30F6220F840C7132EFE3A65E00AF34E742B4D0302DB',
  b: '0x2',
  r: '0x1E65C07150AAA0D524CBB78C3D8883E1031C4CBBF8E997802BCD39D0AD340C0B6C',
}, {
  a: '-0x418B6',
  b: '0x6E',
  r: '-0x1062D8000000000000000000000000000',
}, {
  a: '0x7BC380E3855A45891822F48C918F4AD781343D9291E994BC78C9704A2E503',
  b: '0xB',
  r: '0x3DE1C071C2AD22C48C117A4648C7A56BC09A1EC948F4CA5E3C64B82517281800',
}, {
  a: '-0x5A499FC465E16B0CC44E4E5027CE3E6FCB61031BF81A23BF',
  b: '0xDD',
  r: '-0xB4933F88CBC2D619889C9CA04F9C7CDF96C20637F034477E0000000000000000000000000000000000000000000000000000000',
}, {
  a: '-0x4A8598896BE5401190E6',
  b: '0xF7',
  r: '-0x2542CC44B5F2A008C87300000000000000000000000000000000000000000000000000000000000000',
}, {
  a: '-0x81DF',
  b: '0xCE',
  r: '-0x2077C000000000000000000000000000000000000000000000000000',
}, {
  a: '0x2A226316C5D9A14073ED98535DD4C1',
  b: '0x0',
  r: '0x2A226316C5D9A14073ED98535DD4C1',
}, {
  a: '0xEC90AF2908313304E32900C653A6579BBAB766181E17DC075',
  b: '-0x6C',
  r: '0xEC90AF2908313304E32900',
}, {
  a: '-0x7BE9C',
  b: '-0xE',
  r: '-0x1F',
}, {
  a: '0xEDF5747370ABA1321',
  b: '0xA5',
  r: '0x1DBEAE8E6E1574264200000000000000000000000000000000000000000',
}, {
  a: '-0xB1D0C2F4C1F651FADAEFE06F',
  b: '-0x3',
  r: '-0x163A185E983ECA3F5B5DFC0E',
}, {
  a: '0xF2ACFC2A6D895AC',
  b: '0x63',
  r: '0x79567E1536C4AD60000000000000000000000000',
}, {
  a: '0xF6',
  b: '0xD4',
  r: '0xF600000000000000000000000000000000000000000000000000000',
}, {
  a: '0x6F943E',
  b: '-0x9',
  r: '0x37CA',
}, {
  a: '-0xD75FAD0A732653C701FD6532A8544990CB0537190BB20C7C756F61A82AD',
  b: '-0xE',
  r: '-0x35D7EB429CC994F1C07F594CAA15126432C14DC642EC831F1D5BD86B',
}, {
  a: '-0xBA16BAE9FA73702C9FF39FA61A4C9',
  b: '0x70',
  r: '-0xBA16BAE9FA73702C9FF39FA61A4C90000000000000000000000000000',
}, {
  a: '-0x188F6A40B2E7BF07',
  b: '0x60',
  r: '-0x188F6A40B2E7BF07000000000000000000000000',
}, {
  a: '-0xC8B97B0F68F59CD2AFCDA8D5349FB576E50D74E0A079684B801C1263D0665354D2D',
  b: '0x1',
  r: '-0x19172F61ED1EB39A55F9B51AA693F6AEDCA1AE9C140F2D097003824C7A0CCA6A9A5A',
}, {
  a: '0x8CAA61FD30E3615FF8D9FEBD5E6B78539F15BE4109A73C2F34DCA1BF3DB',
  b: '-0xB9D',
  r: '0x0',
}, {
  a: '-0x699C2FE7D621AEC51B79EFADE2CC2EF27785F2B53FB',
  b: '0x0',
  r: '-0x699C2FE7D621AEC51B79EFADE2CC2EF27785F2B53FB',
}, {
  a: '0x1436085F68FA1F07707941298E928B499649610FA55434BFAC3F199963CE9A3BD59C',
  b: '0x6',
  r: '0x50D8217DA3E87C1DC1E504A63A4A2D265925843E9550D2FEB0FC66658F3A68EF56700',
}, {
  a: '0xC644F920C56A15B87FBD70857A68916B15562314E',
  b: '-0xA',
  r: '0x31913E48315A856E1FEF5C215E9A245AC55588C',
}, {
  a: '0x356C1C97',
  b: '0x3B',
  r: '0x1AB60E4B800000000000000',
}, {
  a: '0xDDE75CAB6879D885BB47D28A8E6A201B400B3B2022199F39C65E8153',
  b: '-0x7F4',
  r: '0x0',
}, {
  a: '-0x9A7DA31AA466694AD57C9B6F6A6C1A8B09C9E18B95406B750626EA35',
  b: '0x0',
  r: '-0x9A7DA31AA466694AD57C9B6F6A6C1A8B09C9E18B95406B750626EA35',
}, {
  a: '-0x1151DDF055A27',
  b: '-0xE44',
  r: '-0x1',
}, {
  a: '-0x3D17B4B35C671A385DEFF',
  b: '0x86',
  r: '-0xF45ED2CD719C68E177BFC000000000000000000000000000000000',
}, {
  a: '-0xD4389A9E269888DE5EEAFA9047DE1801F0E1A29971CE78D',
  b: '0x0',
  r: '-0xD4389A9E269888DE5EEAFA9047DE1801F0E1A29971CE78D',
}, {
  a: '0xB98457551AABF757BAA278139A3256B6183605B51B382640AF82106AF32D3',
  b: '-0xD48',
  r: '0x0',
}, {
  a: '0x2A92DA80CEA6380BB7D426DC6F7C9C1345458093DDFF',
  b: '0x0',
  r: '0x2A92DA80CEA6380BB7D426DC6F7C9C1345458093DDFF',
}, {
  a: '0x4435FF0E45877555FCBC2BE16BC',
  b: '0xE2',
  r: '0x110D7FC39161DD557F2F0AF85AF000000000000000000000000000000000000000000000000000000000',
}, {
  a: '-0x16E0AB9810C59EFCA0D7FEFF5F210049678A040B8391',
  b: '-0xA',
  r: '-0x5B82AE6043167BF2835FFBFD7C8401259E28102E1',
}, {
  a: '-0xBE35A27E7064867AE76D9445',
  b: '0x44',
  r: '-0xBE35A27E7064867AE76D944500000000000000000',
}, {
  a: '-0x3C72',
  b: '0xDD',
  r: '-0x78E40000000000000000000000000000000000000000000000000000000',
}, {
  a: '0xFC868A7F42F2F2A64538E7CDE2C88824A56A18B62',
  b: '-0x87',
  r: '0x1F90D14F',
}, {
  a: '-0x90592A',
  b: '0x23',
  r: '-0x482C95000000000',
}, {
  a: '-0x97284D07B75F78201BE1B504E759EBA27065B9BFE357F546B971A5EC6ADE',
  b: '0xD',
  r: '-0x12E509A0F6EBEF04037C36A09CEB3D744E0CB737FC6AFEA8D72E34BD8D5BC000',
}, {
  a: '0x2CDCC4ED39CB882',
  b: '0x6E',
  r: '0xB37313B4E72E208000000000000000000000000000',
}, {
  a: '-0x1EC35E5EF5753BB186890',
  b: '0x57',
  r: '-0xF61AF2F7ABA9DD8C34480000000000000000000000',
}, {
  a: '-0x906C148E68DFF21BDA06C85F19BAA5089',
  b: '0xE9',
  r: '-0x120D8291CD1BFE437B40D90BE33754A1120000000000000000000000000000000000000000000000000000000000',
}, {
  a: '0x79F54C75271A26CC7179E7187ED',
  b: '0xC6',
  r: '0x1E7D531D49C689B31C5E79C61FB40000000000000000000000000000000000000000000000000',
}, {
  a: '-0x2162A1EED30DC53345EF4EA47D6EB6B7B0D9B050F75B3979E51D88AC77DC3AA9',
  b: '0x1',
  r: '-0x42C543DDA61B8A668BDE9D48FADD6D6F61B360A1EEB672F3CA3B1158EFB87552',
}, {
  a: '-0xC8C428F760268BBAD',
  b: '0xF7',
  r: '-0x6462147BB01345DD680000000000000000000000000000000000000000000000000000000000000',
}, {
  a: '0x6427735109EC0EF52354F9297859348F80BB064AC09DFEBC0C3951DAC1B',
  b: '-0x30',
  r: '0x6427735109EC0EF52354F9297859348F80BB064AC09DFEB',
}, {
  a: '-0x5BD616AB623342E73B8',
  b: '0x62',
  r: '-0x16F585AAD88CD0B9CEE0000000000000000000000000',
}, {
  a: '-0x95D915CE925A59F6F616B0726235F9B05A938',
  b: '-0x7',
  r: '-0x12BB22B9D24B4B3EDEC2D60E4C46BF360B53',
}, {
  a: '-0xEE68B03560A18A10',
  b: '-0x2',
  r: '-0x3B9A2C0D58286284',
}, {
  a: '0x3662E651ED893747E1F78176301D678E6396',
  b: '0x0',
  r: '0x3662E651ED893747E1F78176301D678E6396',
}, {
  a: '0xAA8153628D0D77C0184FF4221828395A8F76068AFC61E032F3A1',
  b: '0x9A',
  r: '0x2AA054D8A3435DF00613FD08860A0E56A3DD81A2BF18780CBCE8400000000000000000000000000000000000000',
}, {
  a: '-0xD81D0',
  b: '-0x4',
  r: '-0xD81D',
}, {
  a: '0xC68FBD6E56A1499FEC0EF564786C3A655E07432EA7F923FB616',
  b: '0x0',
  r: '0xC68FBD6E56A1499FEC0EF564786C3A655E07432EA7F923FB616',
}, {
  a: '-0x484773CBB568F602F7A7D896ADA0A0DA75A1F45FC6D5052D1B30F0D7FEF60BAB',
  b: '-0x3D5',
  r: '-0x1',
}, {
  a: '0x79DEF811241FE378CB5D17BA7A168A36',
  b: '-0x4D1',
  r: '0x0',
}, {
  a: '0x6F445416B6E1D2A3B3B10AD2846CFAEA9FB6B',
  b: '-0xEE7',
  r: '0x0',
}, {
  a: '0x76B980909A9F710A50D9841914AC520FE8384580E36D2BBABE',
  b: '0xBB',
  r: '0x3B5CC0484D4FB885286CC20C8A562907F41C22C071B695DD5F00000000000000000000000000000000000000000000000',
}, {
  a: '0x6FB60FFB33D1A58820F5322EBA524D5D75',
  b: '-0x51A',
  r: '0x0',
}, {
  a: '0xAA5F2971FC1A601EB39FA',
  b: '-0x210',
  r: '0x0',
}, {
  a: '-0xA093',
  b: '0x80',
  r: '-0xA09300000000000000000000000000000000',
}, {
  a: '0x5273B1C4579776EB5A06',
  b: '-0x47',
  r: '0xA4',
}, {
  a: '0x65DE4C6DFEC1FA90',
  b: '0x90',
  r: '0x65DE4C6DFEC1FA90000000000000000000000000000000000000',
}, {
  a: '0x9E87B58C682214C3D7F1FE0FA518620CFC3A069E011CDB86BD204452768066ED7BFD4',
  b: '-0x4',
  r: '0x9E87B58C682214C3D7F1FE0FA518620CFC3A069E011CDB86BD204452768066ED7BFD',
}, {
  a: '-0x39E1DBB5E03425FA00C',
  b: '-0x7AC',
  r: '-0x1',
}, {
  a: '-0xA727B67DFF2D038FCE3C57A70D97595F6208C7ED5FC875233F37428AA22C2501DEEB3',
  b: '0xC',
  r: '-0xA727B67DFF2D038FCE3C57A70D97595F6208C7ED5FC875233F37428AA22C2501DEEB3000',
}, {
  a: '-0x9F82CD4D2C9FC47CDC12A628AF492553C07E4137B4802D7095D',
  b: '-0xE1',
  r: '-0x1',
}, {
  a: '-0x3D87518D31BFF675ADEF0CF',
  b: '0x8A',
  r: '-0xF61D4634C6FFD9D6B7BC33C0000000000000000000000000000000000',
}, {
  a: '0xA0C11E549531D54433DB5B9C5E3EDA1E',
  b: '0x37',
  r: '0x50608F2A4A98EAA219EDADCE2F1F6D0F00000000000000',
}, {
  a: '-0x98DD0FFAC483ECFB',
  b: '-0xF52',
  r: '-0x1',
}, {
  a: '0x1F1070489F3FFE48D72DF94F29384E1EE686C104995947EE1CD13E583ACE86040F',
  b: '0x0',
  r: '0x1F1070489F3FFE48D72DF94F29384E1EE686C104995947EE1CD13E583ACE86040F',
}, {
  a: '0xB22DDBD67199428665CD0978910548A5466408ECC240F539966B8116C46A',
  b: '0x2',
  r: '0x2C8B76F59C6650A19973425E244152295199023B30903D4E659AE045B11A8',
}, {
  a: '0x22683A280278709261332E195178D0C9AA9EB4855022A2EEC62FC9A3886',
  b: '-0x2B',
  r: '0x44D0745004F0E124C2665C32A2F1A193553D690AA04545DD',
}, {
  a: '0xC993A26715180037360AF623B7DA933A2D532950749C7F9',
  b: '0xB4',
  r: '0xC993A26715180037360AF623B7DA933A2D532950749C7F9000000000000000000000000000000000000000000000',
}, {
  a: '-0x2C0',
  b: '0xCD',
  r: '-0x580000000000000000000000000000000000000000000000000000',
}, {
  a: '0x70A826EBDF73A4B2877B88D869ED9705BCED64162866C8F08F519A1',
  b: '0x9',
  r: '0xE1504DD7BEE749650EF711B0D3DB2E0B79DAC82C50CD91E11EA334200',
}, {
  a: '0x517F570EED4AFA28A49BDF73D0A8CE6245D2A89',
  b: '0x4F',
  r: '0x28BFAB8776A57D14524DEFB9E854673122E954480000000000000000000',
}, {
  a: '-0x3B1263ADED29109FD961A6381ABD9',
  b: '0x94',
  r: '-0x3B1263ADED29109FD961A6381ABD90000000000000000000000000000000000000',
}, {
  a: '-0xC8DC8FC84B41334A8B2473E5C6790583C382A0F3E70E4CA0484',
  b: '0x0',
  r: '-0xC8DC8FC84B41334A8B2473E5C6790583C382A0F3E70E4CA0484',
}, {
  a: '-0x4E581A62AA1C78A3D628EF5F8E5CEA3E4B5A9219BFE',
  b: '0x22',
  r: '-0x13960698AA871E28F58A3BD7E3973A8F92D6A4866FF800000000',
}, {
  a: '0xCB13746E289C020F45AA82183F600FE1AB51',
  b: '0x0',
  r: '0xCB13746E289C020F45AA82183F600FE1AB51',
}, {
  a: '0x2B43AB1D330CBE63',
  b: '0xA6',
  r: '0xAD0EAC74CC32F98C00000000000000000000000000000000000000000',
}, {
  a: '-0xFA294AD23DAC32C421FBA2B7849C4E159D5A2F028E7DE039D879FADB37B1E1',
  b: '0x4',
  r: '-0xFA294AD23DAC32C421FBA2B7849C4E159D5A2F028E7DE039D879FADB37B1E10',
}, {
  a: '0x3D83B670A54C273D590C44CD5426A11607B1E84FE7893EB5C4B327237103B',
  b: '0x5',
  r: '0x7B076CE14A984E7AB218899AA84D422C0F63D09FCF127D6B89664E46E20760',
}, {
  a: '-0xF6FDDBC0B6ECD7F64E1391A200DC9B1DC67B54',
  b: '-0xD',
  r: '-0x7B7EEDE05B766BFB2709C8D1006E4D8EE34',
}, {
  a: '0xB1BD82F8FB2C9FF5A10EC2614098FCF6543B87FB7698A6E2083',
  b: '0x5C',
  r: '0xB1BD82F8FB2C9FF5A10EC2614098FCF6543B87FB7698A6E208300000000000000000000000',
}, {
  a: '-0xE32658600B215D7357196CFB49BE36659F2977BDDAD3EC2',
  b: '0x3D',
  r: '-0x1C64CB0C01642BAE6AE32D9F6937C6CCB3E52EF7BB5A7D84000000000000000',
}, {
  a: '0x468419D955BCDEA88B32EE566350B80C3B57A24DEFEB2AA081',
  b: '-0x9',
  r: '0x23420CECAADE6F544599772B31A85C061DABD126F7F59550',
}, {
  a: '-0x99D308EA30ACBED40DE3C9DCCEC7',
  b: '-0x7D',
  r: '-0x1',
}, {
  a: '0x3ED99802BCDFB73FE144EA2E9779A421179D8',
  b: '0xD9',
  r: '0x7DB3300579BF6E7FC289D45D2EF348422F3B0000000000000000000000000000000000000000000000000000000',
}, {
  a: '0x7E58A32AC7B83F5',
  b: '0x41',
  r: '0xFCB146558F707EA0000000000000000',
}, {
  a: '-0x190F30816295C4417FDCAA947C7C909F78EB683F610EF62853E8882B565B0EAACB4E',
  b: '-0x1B0',
  r: '-0x1',
}];

const dataSmall = [{
  a: '0x5FE0E0',
  b: '0x5',
  r: '0xBFC1C00',
}, {
  a: '-0x6B47A8B7845',
  b: '-0x1A',
  r: '-0x1AD1F',
}, {
  a: '0xAD4A7760B839',
  b: '0xC',
  r: '0xAD4A7760B839000',
}, {
  a: '-0x2B7672D8199',
  b: '0x6',
  r: '-0xADD9CB606640',
}, {
  a: '-0xCD5925',
  b: '0x0',
  r: '-0xCD5925',
}, {
  a: '0x3A64952BC5',
  b: '-0x5',
  r: '0x1D324A95E',
}, {
  a: '0x7A0A9513F3CF22',
  b: '0xD',
  r: '0xF4152A27E79E44000',
}, {
  a: '-0xB6',
  b: '0x4',
  r: '-0xB60',
}, {
  a: '-0x9BF5D264A',
  b: '0x0',
  r: '-0x9BF5D264A',
}, {
  a: '0x91ED6EA2',
  b: '0x8',
  r: '0x91ED6EA200',
}, {
  a: '0x341ED45D4A164',
  b: '-0x5D',
  r: '0x0',
}, {
  a: '0x1964',
  b: '0xD',
  r: '0x32C8000',
}, {
  a: '-0x638DC3813D',
  b: '-0x9',
  r: '-0x31C6E1C1',
}, {
  a: '0xF98EFE9792',
  b: '0x4',
  r: '0xF98EFE97920',
}, {
  a: '0x91F3639C2BA0',
  b: '0x8',
  r: '0x91F3639C2BA000',
}, {
  a: '-0x181F3FD8',
  b: '0xE',
  r: '-0x607CFF60000',
}, {
  a: '-0xEAC2E7E29C4',
  b: '0xD',
  r: '-0x1D585CFC5388000',
}, {
  a: '0xBA105E16A36',
  b: '0x0',
  r: '0xBA105E16A36',
}, {
  a: '-0xD0F2',
  b: '0xC',
  r: '-0xD0F2000',
}, {
  a: '-0x105F17D10BA',
  b: '0x3',
  r: '-0x82F8BE885D0',
}, {
  a: '-0xFE96CEDCBE',
  b: '0x0',
  r: '-0xFE96CEDCBE',
}, {
  a: '0xA',
  b: '-0x891',
  r: '0x0',
}, {
  a: '-0xAD11',
  b: '0x9',
  r: '-0x15A2200',
}, {
  a: '-0x2E3E889B52477',
  b: '0xC',
  r: '-0x2E3E889B52477000',
}, {
  a: '0x2B0FD6B2BD9',
  b: '0x6',
  r: '0xAC3F5ACAF640',
}, {
  a: '0x63F',
  b: '0xC',
  r: '0x63F000',
}, {
  a: '0x58438028DAA5F0',
  b: '-0xC12',
  r: '0x0',
}, {
  a: '0x80AD',
  b: '-0xF',
  r: '0x1',
}, {
  a: '-0x8',
  b: '0x3',
  r: '-0x40',
}, {
  a: '0x8',
  b: '0x4',
  r: '0x80',
}, {
  a: '0x6B9365B65B8B',
  b: '0x0',
  r: '0x6B9365B65B8B',
}, {
  a: '0x9EAF82DF9',
  b: '-0x3E3',
  r: '0x0',
}, {
  a: '0xF94A1230122',
  b: '-0xF',
  r: '0x1F294246',
}, {
  a: '-0x33A649747',
  b: '-0xF4',
  r: '-0x1',
}, {
  a: '-0x91A9AC',
  b: '0x7',
  r: '-0x48D4D600',
}, {
  a: '0xF8D',
  b: '0xB',
  r: '0x7C6800',
}, {
  a: '0x4E1126',
  b: '0xD',
  r: '0x9C224C000',
}, {
  a: '0x84',
  b: '-0x8',
  r: '0x0',
}, {
  a: '-0x6',
  b: '0x3',
  r: '-0x30',
}, {
  a: '-0xD0B2036B',
  b: '-0x937',
  r: '-0x1',
}, {
  a: '-0x6991C70C13F562C',
  b: '0x0',
  r: '-0x6991C70C13F562C',
}, {
  a: '0x2C649179C6B51F',
  b: '0x3',
  r: '0x163248BCE35A8F8',
}, {
  a: '-0x67417A8CC',
  b: '0x9',
  r: '-0xCE82F519800',
}, {
  a: '-0x37',
  b: '0x6',
  r: '-0xDC0',
}, {
  a: '0x0',
  b: '0x8E',
  r: '0x0',
}, {
  a: '0x889DB196A',
  b: '0xB',
  r: '0x444ED8CB5000',
}, {
  a: '0xB593E5C',
  b: '-0xC57',
  r: '0x0',
}, {
  a: '0x92FE5D1CC',
  b: '-0xAA0',
  r: '0x0',
}, {
  a: '-0xD240EC48B77FFAD',
  b: '-0x28F',
  r: '-0x1',
}, {
  a: '-0xB',
  b: '-0x430',
  r: '-0x1',
}, {
  a: '-0xE558004FCFEA771',
  b: '-0xBB',
  r: '-0x1',
}, {
  a: '0x0',
  b: '0x33',
  r: '0x0',
}, {
  a: '0x2',
  b: '-0x4DB',
  r: '0x0',
}, {
  a: '0x265BE',
  b: '0xD',
  r: '0x4CB7C000',
}, {
  a: '-0x100',
  b: '-0x3A4',
  r: '-0x1',
}, {
  a: '-0x9E6E299A70',
  b: '0xA',
  r: '-0x279B8A669C000',
}, {
  a: '-0x704B542B89D5',
  b: '0x5',
  r: '-0xE096A85713AA0',
}, {
  a: '0x21EE0',
  b: '-0x9F',
  r: '0x0',
}, {
  a: '0x1AC609322E0',
  b: '-0x2',
  r: '0x6B1824C8B8',
}, {
  a: '-0xD46B1FB',
  b: '0xF',
  r: '-0x6A358FD8000',
}, {
  a: '0x10',
  b: '0x9',
  r: '0x2000',
}, {
  a: '-0xBFB08C8',
  b: '-0x4',
  r: '-0xBFB08D',
}, {
  a: '0x9BC3EDDF2BDE',
  b: '0x1',
  r: '0x13787DBBE57BC',
}, {
  a: '0x3',
  b: '-0x1D',
  r: '0x0',
}, {
  a: '0x5E',
  b: '0x9',
  r: '0xBC00',
}, {
  a: '-0x2508D7233',
  b: '0xB',
  r: '-0x12846B919800',
}, {
  a: '0x60E79EFE',
  b: '0xB',
  r: '0x3073CF7F000',
}, {
  a: '-0x6',
  b: '-0x68',
  r: '-0x1',
}, {
  a: '-0xAEFB1212AC6537',
  b: '-0x3',
  r: '-0x15DF6242558CA7',
}, {
  a: '-0x2FF0452357DF1F',
  b: '0x6',
  r: '-0xBFC1148D5F7C7C0',
}, {
  a: '-0x8C3C852A8FB',
  b: '-0xAC',
  r: '-0x1',
}, {
  a: '0x0',
  b: '-0xB',
  r: '0x0',
}, {
  a: '-0xF8F679B',
  b: '0x0',
  r: '-0xF8F679B',
}, {
  a: '0x737760CA51326AE',
  b: '0x3',
  r: '0x39BBB06528993570',
}, {
  a: '0x8B697',
  b: '-0xF43',
  r: '0x0',
}, {
  a: '-0xD1',
  b: '-0xC',
  r: '-0x1',
}, {
  a: '0x11',
  b: '-0x327',
  r: '0x0',
}, {
  a: '-0x2',
  b: '-0x7',
  r: '-0x1',
}, {
  a: '0xE57F07A2',
  b: '0xF',
  r: '0x72BF83D10000',
}, {
  a: '0xB57EA2EDF89D',
  b: '0xA',
  r: '0x2D5FA8BB7E27400',
}, {
  a: '0x0',
  b: '-0xDC',
  r: '0x0',
}, {
  a: '0x50A47FE87AFA',
  b: '0x7',
  r: '0x28523FF43D7D00',
}, {
  a: '-0xAE5A',
  b: '-0xB98',
  r: '-0x1',
}, {
  a: '0xD742A211936CC8D',
  b: '-0x3FD',
  r: '0x0',
}, {
  a: '0xBDA6',
  b: '0x0',
  r: '0xBDA6',
}, {
  a: '0xE891',
  b: '-0xD17',
  r: '0x0',
}, {
  a: '-0x631794C7C',
  b: '0x3',
  r: '-0x318BCA63E0',
}, {
  a: '-0xC80593E1DBB',
  b: '-0x5',
  r: '-0x6402C9F0EE',
}, {
  a: '0xDCF7E4C1CC',
  b: '-0xBC',
  r: '0x0',
}, {
  a: '-0x27FB9D365E9F61',
  b: '0x1',
  r: '-0x4FF73A6CBD3EC2',
}, {
  a: '0x7',
  b: '0x3',
  r: '0x38',
}, {
  a: '0x8B5',
  b: '0x5',
  r: '0x116A0',
}, {
  a: '0xFA07C96BE308',
  b: '0x0',
  r: '0xFA07C96BE308',
}, {
  a: '-0xECB5AA0D0',
  b: '-0x7A0',
  r: '-0x1',
}, {
  a: '0x9B9C033A',
  b: '0xF',
  r: '0x4DCE019D0000',
}, {
  a: '0x3F8AFE5AA',
  b: '0xE',
  r: '0xFE2BF96A8000',
}, {
  a: '-0x2A362F9D278535',
  b: '-0x89',
  r: '-0x1',
}, {
  a: '-0x7E4BC1',
  b: '0x7',
  r: '-0x3F25E080',
}, {
  a: '-0x651BA3C',
  b: '0x0',
  r: '-0x651BA3C',
}, {
  a: '0x11349FDE09F2E1',
  b: '-0x8',
  r: '0x11349FDE09F2',
}];

import JSBI from '../dist/jsbi.mjs';
const JSBigInt = JSBI.BigInt;

let errorCount = 0;

const dataBigNative = [];
const dataBigJsbi = [];
const dataSmallNative = [];
const dataSmallJsbi = [];

function hexParseN(s) {
  if (s.charCodeAt(0) === 0x2D) return -BigInt(s.slice(1));
  return BigInt(s);
}
function parseNative(d) {
  if (d.b) {
    return {a: hexParseN(d.a), b: hexParseN(d.b), r: hexParseN(d.r)};
  }
  return {a: hexParseN(d.a), r: hexParseN(d.r)};
}
function hexParse(s) {
  if (s.charCodeAt(0) === 0x2D) {
    const result = JSBigInt(s.slice(1));
    result.sign = true;
    return result;
  }
  return JSBigInt(s);
}
function parseJSBI(d) {
  if (d.b) {
    return {a: hexParse(d.a), b: hexParse(d.b), r: hexParse(d.r)};
  }
  return {a: hexParse(d.a), r: hexParse(d.r)};
}
function prepareData(src, dstNative, dstJsbi) {
  for (let i = 0; i < src.length; i++) {
    const d = src[i];
    dstNative.push(parseNative(d));
    dstJsbi.push(parseJSBI(d));
  }
}
prepareData(dataBig, dataBigNative, dataBigJsbi);
prepareData(dataSmall, dataSmallNative, dataSmallJsbi);


function testNative(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = d.a << d.b;
    if (d.r !== r) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: <<');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = d.a << d.b;
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (d.r !== r) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


function testJsbi(data, reps) {
  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    const r = JSBI.leftShift(d.a, d.b);
    if (!JSBI.equal(r, d.r)) {
      console.log('Input A:  ' + d.a.toString(16));
      console.log('Input B:  ' + d.b.toString(16));
      console.log('Result:   ' + r.toString(16));
      console.log('Expected: ' + d.r.toString(16));
      console.log('Op: leftShift');
      errorCount++;
    }
  }
  let r;
  const t1 = Date.now();
  for (let j = 0; j < reps; j++) {
    for (let i = 0; i < data.length; i++) {
      const d = data[i];
      r = JSBI.leftShift(d.a, d.b);
    }
  }
  // Confuse the compiler into thinking that the loop is needed :-)
  const d = data[data.length - 1];
  if (!JSBI.equal(r, d.r)) throw new Error('no dead code elimination please');
  return Date.now() - t1;
}


const kRepsBig = 40000;
const kRepsSmall = 120000;

console.log('Testing leftShift:');
console.log('Native/big:   ' + testNative(dataBigNative, kRepsBig));
console.log('JSBI/big:     ' + testJsbi(dataBigJsbi, kRepsBig));
console.log('Native/small: ' + testNative(dataSmallNative, kRepsSmall));
console.log('JSBI/small:   ' + testJsbi(dataSmallJsbi, kRepsSmall));

if (errorCount !== 0) {
  console.error('Finished with ' + errorCount + ' errors.');
  // Support both d8 (`quit`) and Node.js (`process.exit`).
  (typeof quit !== 'undefined' ? quit : process.exit)(1);
}
